package table;

import javax.swing.JScrollPane;
import javax.swing.table.DefaultTableModel;

import models.TableSelectionModel;
import quary.QuaryBridge;

public class VinylView extends AbstractTable{
	
	private static final long serialVersionUID = 1L;
	
	private static final String[] COLUMN_IDENTIFIERS  = {
		 "VinylID", 
		 "Artist",
		 "Album",
		 "Musikk Stil",
		 "Format",
		 "Plateselskap",
		 "Plassering"
	};

	private QuaryBridge quaryBridge;

	public VinylView(JScrollPane contentPane, QuaryBridge quaryBridge) {
		super(contentPane);
		
		this.quaryBridge = quaryBridge;
		this.setTableModel(new DefaultTableModel());
		this.setListSelectionModel(new TableSelectionModel(this));
	}
	
	@Override 
	public void activate() {
		this.populate();
		
		super.activate();
	}
	
	public void deactivate() {
		super.deactivate();
	}
	
	@Override
	protected void populate() {
		this.setData(this.quaryBridge.getVinylList(), COLUMN_IDENTIFIERS);
	}
	
	public int getTableID() {
		return AbstractTable.VINYL_VIEW;
	}
	
	@Override
	protected Object[] getDataAtRow(int row) {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public int insertLastRowToDatabase() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteSelectedRowsFromDatabase() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateRowInDatabase(int row) {
		// TODO Auto-generated method stub
		return 0;
	}
}
